<?php
/**
 * Created by PhpStorm.
 * User: 50330
 * Date: 2019/4/16
 * Time: 19:31
 */

namespace App\Http\Controllers;

use Illuminate\Http\Request;

class Weixinlogin extends Controller
{

    // 用户点击微信登录按钮后，调用此方法请求微信接口
    public function redirectToProvider(Request $request)
    {
        return \Socialite::with('weixinweb')->redirect();
    }
    public function handleProviderCallback(Request $request)
    {
        $user_data = \Socialite::with('weixinweb')->user();

        //获取微信用户信息,并作后续处理,appid
        dd($user_data);
    }

}